Recording medium defect management

ABSTRACT

A recording medium (D) comprises a file system area (FSA), a data area (DAA) and an initial defect management area (DMA). A system comprises a drive (DR) for writing data (DA) to or reading data (DR) from the data area (DAA) or the defect management area (DMA), and a host (H) for sending data (DA) to or for receiving data (DA) from the drive (DR) when the drive (DR) is in a mounted state wherein a file system (FS) in the file system area (FSA) is available to the host (H). The method of accessing such a recording medium (D) detects (S 1 ) whether a shortage of free space in the defect management area (DMA) is to be expected, and if yes, allocates (S 2 ) supplemental defect management area (SDMA) at the cost of the data area (DAA). The file system (FS) is adapted to reflect the latest state of available data area (DAA) and the allocated supplemental defect management area (SDMA). The file system (FS) is adapted during an adaptation period related to a mounting or an unmounting phase wherein the host (H) mounts or unmounts the drive (DR). The host (H) unmounts or releases the drive (DR) when no further data has to be exchanged between the host (H) and the drive (DR).

The invention relates to a method of accessing a recording medium, anapparatus for accessing a recording medium, a computer program productfor recording information, and a recording medium.

EP-A-1014365 discloses a recording medium on which a data area, a sparearea for defect management, and management information of the spare areaare allocated. The data to be stored on the recording medium is writtenin the data area. If during the writing or reading of data into the dataarea a critical state occurs, the defect area in which the criticalstate occurs is remapped to (part of) the spare area. This remapping,usually of ECC sectors, is recorded on the recording medium in a defectlist. Thus, after the remapping, whenever the defective area isaddressed, the defect list indicates the actual area where theinformation is stored instead of in the defective area.

A primary spare area is allocated for slipping replacement and linearreplacement upon initializing of the recording medium. A secondary sparearea is allocated for linear replacement after initialization of therecording medium. Both areas have a defect list. The primary spare areais used to cope with defective areas which are detected during theinitializing (formatting) of the recording medium. The secondary area isused to cope with defects which occur during the use of the recordingmedium after the initializing. If the total spare area allocated in theprimary and the secondary spare area is insufficient, a supplementaryspare area is allocated. As long as the data area is not yet completelyoccupied by data, a recording medium on which relatively many defectsoccur can still be used. The sizes of the primary and the supplementaryspare areas are determined by the number of defects generated uponinitialization. The information on the sizes of the spare areas and theremainder state information representing the degree of use of the spareareas are recorded on the recording medium.

It is a drawback of the prior art that the size of the supplementaryspare areas is determined during the initialization of the disc.

It is an object of the invention to provide a more flexible allocationof the supplemental spare areas.

A first aspect of the invention provides a method of accessing arecording medium. A second aspect of the invention provides an apparatusfor accessing a recording medium. A third aspect of the inventionprovides a computer program product for recording information. A fourthaspect of the invention provides a recording medium. Advantageousembodiments are defined in the dependent claims.

In accordance with the first aspect of the invention, the method issuitable to use recording media which comprise a data area and aninitial defect management area. The method is used in a system whichcomprises a drive for writing data to or reading data from the recordingmedium, and a host for sending data to or for receiving data from thedrive when the recording medium is in a mounted state. In the mountedstate, file system information (which may be present in the file systemarea and usually at least one supplemental file in the data area) on therecording medium is available to the host. Consequently, the host isable to write data to and/or to read data from the recording medium. Themethod of accessing such a recording medium detects whether a shortageof free space in the defect management area is to be expected, and ifyes, allocates supplemental defect management area at the cost of thedata area. Then, the file system is updated to reflect the latest stateof available data area and the allocated supplemental defect managementarea. The file system is adapted during an adaptation period related tothe mounting phase, or to an unmounting phase. In the mounting orunmounting phase, the host mounts or unmounts the recording medium,respectively. The host can unmount or release the recording medium whenthe user activates the eject button of the drive directly or viasoftware, and no further data has to be exchanged between the host andthe drive. The unmount action may also be initiated by software. In theunmounted state, the host has no information about the position of userdata on the recording medium. The recording medium is unmounted, forexample, every time the recording medium is removed from the drive orwhen the drive indicates to the operating system (further referred to asthe OS) to unmount the medium.

In accordance with an aspect of the invention, the checking forsufficient free space in the defect management area already allocated,the allocation of supplemental defect management area, and theadaptation of the file system information is related to the mounting orthe unmounting phase. The total amount of defect management area can beupdated every time the recording medium is mounted or unmounted. Themaximum amount of defect management area is not fixed a single time atinitializing (formatting) the recording medium as occurs in the priorart. The allocation of supplemental defect management area during themounting or unmounting phase enables to manage the defect managementareas more flexible. If a recording medium contains a limited amount ofdata, a large total amount of defect management area can be allocated,much larger than the fixed amount in the prior art.

An advantage of increasing the supplementary spare area during or justbefore the mounting process or just after the unmounting process is thatthe OS need not be adapted to allow a change of the total amount of dataarea during normal operation when the drive is mounted under the OS. Itis preferred to change the supplementary spare area during theunmounting process because the amount of available free space on therecording medium is exactly known and will not be changed during themounting phase by writing data to or deleting data from the recordingmedium. This enables the recording medium to be used in drives which donot support the re-sizing itself. Preferably, the defect managementresizing is not performed during the mounting phase as the OS wants toaccess the information on the recording medium as soon as possible.

It is possible that the drive, for example at regular intervals, startsa process of checking whether supplementary spare area has to beallocated and actually allocating this supplementary area and updatingthe file system information while the recording medium is still in themounted phase. The drive responses with an error message at any attemptby the host to read data from or to write data to the recording medium.

The recording medium may be a recordable or a rewritable optical disc,the host may be a personal computer, and the drive may be an opticaldrive such as, for example, a CD or a DVD drive. The drive may beexternally connected to the PC or may be part of the PC.

In an embodiment of the invention, the host, which usually is a PC,detects the expected shortage, allocates the supplemental spare area,and adapts the file system information accordingly, before the recordingmedium is unmounted. The intelligence is available in the host; thedrive may be a standard drive.

In a further embodiment of the invention, the drive adapts the filesystem information after the host released or unmounted the recordingmedium. A special intelligent drive has to be used. It is an advantagethat the tasks performed by the drive need not be performed by the host.

In a further embodiment of the invention, the host detects the expectedshortage of defect management area to provide information to the driveabout the state of the defect management area, for example the exactamount of or a percentage indicating the used or free space in thedefect management area, or by keeping track of the number ofreplacements in the defect tables. Or, in the same manner as inEP-A-1014365, the usage of the defect management area is indicated byflags.

Further, the host detects the amount of free space in the data areawhich may be used to extend the defect management area. Both theseaspects are communicated to the drive which uses this information toallocate the supplemental defect management area after the hostunmounted the recordable medium. Again, it is an advantage that thedrive is able to take over part of the activities from the host.

In an embodiment of the invention, after the host unmounted therecordable medium, the drive detects whether a shortage of defectmanagement area is expected based on the evaluation of the DMA'srecorded on the recording medium. Now, even more intelligence isavailable in the drive, which has the advantage that the activitiesrequired by the host to manage the supplemental defect management areasare minimal.

In an embodiment of the invention, the drive detects whether theshortage of defect management area is expected and, if so, communicatesthis to the host. The host decides on whether the defect management areais allowed to be enlarged and communicates its decision to the drive. Ifthe defect management area has to be enlarged, the drive will do so, byfirst checking the file system on the recording medium on availabilityof a sufficient large contiguous free area in the data area. Then, thedrive allocates the free area to the supplemental defect management areaand adapts the file system and defect management tables on the recordingmedium accordingly. The adapted file system indicates the area or areascovered by the supplemental defect area, and the still available areafor data. This embodiment has the advantage that most of the defectmanagement activities are performed by the drive while the host still isin control and may decide on whether, and if yes, how much, the sparearea should be enlarged.

In an embodiment of the invention, after the host receives the warningfrom the drive that a shortage is expected of the free space within thedefect management area allocated so far, the host asks user input on theacceptance of the enlargement of the defect management area at the costof the data area If the user accepts, this is communicated to the drive,and the drive will perform the necessary actions after the recordingmedium is unmounted by the host or during a background process.

The communication with the user may be a simple question whether theuser allows an enlargement of the defect area or not. It is alsopossible to indicate to the user how much free space in the data area isavailable to support his decision in accordance with an embodiment ofthe invention. It is also possible that the user provides the amount offree space in the data area that is to be used to enlarge the defectmanagement area.

In an embodiment of the invention, the host supplies the (or therelevant part of the) file system information to the drive to enable thedrive to enlarge the defect management area. The drive need not be ableto read the file system information itself.

In an embodiment of the invention, the drive itself is able to read therelevant file system information from the recording medium.

In an embodiment of the invention, the allocating step comprises a stepof checking in the data area for a contiguous free part which has tobecome the supplemental defect management area. The supplemental defectmanagement area is preferably a contiguous area to avoid that a defectarea on the recording medium (usually an optical disc) has to be dividedover several parts of a defect management area at different radialpositions on the recording medium. The Jumping between different radialpositions costs some time. This check allows using a free part of thedata area wherever it is positioned. It is not required that this freepart must be located at the end of the disc. It is not required tophysically move data which is present at the end of the disc to allowthe supplemental defect management area to be located at the end of thedisc.

The defect table(s) in the defect management areas (DMA) is updated totake into account the allocated supplemental defect management area.

In an embodiment of the invention, the allocating further comprisesupdating the file system information such that a physical address areaof a used part of the data area at the start or the end of the disc iscoupled to a logical address area within the logical address areaoriginally being coupled to the contiguous free part of the data area.

Before the supplemental defect management area is allocated, in thelogical address area, a free area corresponds to the physical free areawhich is selected to become the supplemental defect management area.Further, the start or the end of the logical address area corresponds tothe start or the end of the physical address area respectively.

After the supplemental defect management area is allocated, the start orthe end of the logical address area is coupled to the physicalsupplemental defect management area which may not be allocated at thestart or the end of the physical address area.

The file system information should be updated to be able to address thedata at the start or the end of the physical address area This meansthat the logical addresses in the address area originally correspondingto the free data area now correspond to the start or the end of thephysical address area. This is elucidated in more detail in FIG. 8.

Now, on the logical level seen by the host, a maximally large contiguousdata area (without a hole because addresses have been taken out whichare not to be used because they correspond to the supplemental defectmanagement area) is available as is demanded by some applications. Thus,although the actual radial position on the disc of the free area may notbe at the start or the end of the disc, the remapping performed providesa disc which at the logical level the host communicates with the drive,looks like a disc on which the free area which is converted to thesupplemental defect area is at the start or the end of the disc.Consequently, the host can act as if the supplemental area is at thestart or the end of the disc, while it actually is not. This has theadvantage that it is not required to perform a time consuming movementof the data present at the start or the end of the disc.

The drive has to remap an error area on the disc such that the data tobe stored in the error area is stored in the supplemental area at itsactual radial position and not at the start or the end of the disc.

In an embodiment of the invention, the free area which is converted tothe supplemental defect management area is physically moved to the startor the end of the disc by the drive. The time consuming copying of datais performed in the background, and the user will not get annoyed byhaving to wait a considerable time.

These and other aspects of the invention are apparent from and will beelucidated with reference to the embodiments described hereinafter.

In the drawings:

FIG. 1 shows a host and a standard drive in accordance with theinvention,

FIG. 2 shows a host and an adapted drive in accordance with theinvention,

FIGS. 3 to 7 show flowcharts of embodiments of the method of allocatingsupplemental defect management, and

FIG. 8 shows an example of the physical arrangement of areas on therecording disc and the logical arrangement of the corresponding areas atthe interface of the drive and the host.

The same references in different Figs. refer to the same signals or tothe same elements performing the same function.

FIG. 1 shows a host and a standard drive in accordance with theinvention. The host H may be a standard personal computer (furtherreferred to as PC) which comprises as drive DR a standard CD-drive or astandard DVD-drive. The drive DR is able to record information on anoptical disc D when present in the drive DR. The PC comprises aprocessor PR which is coupled to the drive DR to exchange data DA andcontrol signals CO between the processor PR and the drive DR. Othercircuits (not shown) such as drive controllers and buffers may bepresent between the processor PR and the drive DR. A two waycommunication is possible between the processor PR and the drive DR towrite data DA to disc D via the drive DR or to read data DA from thedisc D via the drive DR, in the usual manner. As the drive DR is astandard component, the management of the amount of defect managementarea DMA (see FIG. 8) has to be present in the host H. The operation ofthis embodiment in accordance with the invention is elucidated withrespect to the flowchart shown in FIG. 4.

FIG. 2 shows a host and an adapted drive in accordance with theinvention. The host H may be a PC which comprises as drive DR an adaptedCD-drive or an adapted DVD-drive. Again, the drive DR is able to recordinformation on an optical disc D when present in the drive DR. The PCcomprises a processor PR which is coupled to the drive DR to transferdata DA and control signals CO between the processor PR and the driveDR. Other circuits (not shown) such as drive controllers and buffers maybe present between the processor PR and the drive DR. A two waycommunication is possible between the processor PR and the drive DR towrite data DA to disc D via the drive DR or to read data DA from thedisc D via the drive DR in the usual manner. As the drive DR comprises acontrol circuit CC for performing the, or part of the defect management,all or part of the management of the amount of defect management areaDMA is performed by the drive DR. The operation of embodiments inaccordance with the invention which use an adapted drive are elucidatedwith respect to the flowcharts shown in FIGS. 5 to 7.

FIG. 3 shows a flowchart of an embodiment of the method of allocatingsupplemental defect management area.

In step S1 the system of host H and drive DR checks whether a shortageof free space in the defect management area DMA is to be expected. Forexample, the shortage of this free space may be determined as the exactamount of bytes still free in the defect management area DMA. Or, thefree space is indicated as a percentage of the total available amount ofthe defect management area DMA. Or, in the same manner as inEP-A-1014365, multi-bit flags may be stored on the disc D which indicatethe amount of usage of the defect management area DMA (further referredto with DMA only).

If a shortage is detected in step 1, because, for example, the stillfree area in the DMA's is smaller than a predetermined number of bytesor a predetermined percentage, it is checked in step S2 whether it ispossible to allocate supplemental defect management area (furtherreferred to as SDMA) in the data area DAA (see FIG. 8). The data areaDAA is accessible to store user data. It has to be checked in step S2how many bytes are free in the data area DAA of the disc D. The locationof the SDMA will depend on the amount and the location of free space inthe data area DAA on the disc D, and on a location of the DMA's alreadypresent on the disc D.

The location and the size of the DMA's on a recording medium may dependon an agreement in the industry. A first example is to evenly distributeseveral DMA's over the disc to minimize the distance between aparticular defect area DFA (see FIG. 8) on the disc D and the nearestDMA. This minimizes the time required to jump to a DMA. In such anexisting DMA distribution (used on CD's), a desirable location of theSDMA is in-between two existing DMA's. The size of the SDMA preferablyis in the same order as the existing DMA's. In a second example, thealready present DMA's are located at the start and/or the end of thedisc D to ensure an as large as possible contiguous data area DAA. Insuch an existing DMA distribution (used on DVD discs), a desirablelocation of the SDMA is at the end or the start of the disc D to keepthe contiguous data area DAA as large as possible.

The availability and the position of a free space area FDA (see FIG. 8)in the data area DAA is another issue. In principle it is possible touse a free space area FDA whatever its position on the disc D is. Thedrive D is able to remap the free space area FDA to whatever logicaladdress is required at the interfacing between the host H and the driveDR. After the remapping, the host H sees the free space area FDA on thedrive DR at the logical level the host communicates with the drive DR atthe desired position. The drive DR translates the address at the logicallevel to the actual physical position on the disc D. By moving data ifthis data is in the area the free space should be allocated, it ispossible to create the free space at the particular location required.However moving data costs relatively much time and preferably is done bythe drive DR when the drive DR is not used and the host H is nothampered by the moving of the data.

If the SDMA is allocated in size and position, in step S3, the filesystem information FS on the disc D is amended during the adaptationperiod which is related to the mounting or unmounting phase of the driveDR. Usually, the file system information FS is present in a file systemarea FSA and in the data area DAA.

The file system information FS has to be amended such that the free dataarea available to store user data is adapted to reflect that the stillfree data area decreases with the amount the SDMA covers.

The mounting phase of the drive DR is the phase when the host H startscommunication with the drive to make the content of the disc D insertedin the drive DR available to the host H. When the disc D is mounted, thehost H has read the file system information FS stored on the disc D andthe host H is able to write data DA to or to read data DA from the diskD.

The unmounting phase of the drive DR is the phase wherein the host Hstops the communication with the drive DR. When the disc D is unmounted,the host H is not anymore directly able to access the file systeminformation FS of the disc D and is unable to write data DA to or toread data DA from the disc D. The disc D will be unmounted when the useruses the eject button of the drive DR directly or via software to ejectthe disc D.

In accordance with the invention, the SDMA is managed during themounting or the unmounting phase. This is far more often than in theprior art EP-A-1014365 where the size of the SDMA is determined onlyonce during an initializing phase (which is the formatting phase). TheSDMA management in accordance with the invention has the advantage thatthe management of the size and the position of the SDMA's is much moreflexible as it is able to take the actual amount of free data space intoaccount as it evolves during the use of the disc D. It is even possibleto decrease the amount of reserved SDMA if this enables to store a datafile which otherwise would not fit.

No SDMA is allocated if in step S1 no shortage of free space in the DMAarea allocated so far is detected, or if in step S2 is detected that nofree space FDA in the data area DAA is present.

FIG. 4 shows a flowchart of an embodiment of the method of allocatingsupplemental defect management area. In this embodiment, the host Hmanages the whole process of allocating supplemental defect managementarea (SDMA). This allows a standard drive DR to be used.

First, in step S10, the host H mounts the disc D to be able to accessthe disc D. In step S11, the host checks whether a shortage of freespace in the existing DMA's is expected. In step S12, the host H checkswhether sufficient free area FDA in the data area DAA is available atwhat position to allocate a desired amount of SDMA. In step S13, thehost H allocates the desired amount of SDMA in the free area FDA of thedata area DAA. In step S14, the host H adapts the file system FS in thefile system area FSA to be in line with the new situation.

No SDMA is allocated if in step S11 no shortage of free space in the DMAarea allocated so far is detected, or if in step S12 is detected that nofree space FDA in the data area DAA is present.

Although it is an advantage that the host H which has the intelligenceon-board manages the allocation of the SDMA, and a standard drive DR canbe used, it is a disadvantage that the host H has to spend a lot of timeon this process which in part or totally could be performed by the driveDR. In the embodiment of the invention shown in FIG. 5, the drive DRperforms the whole process, in the embodiments of the invention shown inFIGS. 6 and 7, both the host H and the drive DR perform part of theprocess.

FIG. 5 shows a flowchart of an embodiment of the method of allocatingsupplemental defect management area. After the host H unmounts the discD in step S20, in step S21, the drive DR checks in DMA tables recordedon the disc D whether a shortage of free space in the existing DMA's isexpected to occur. The drive DR, when the disc D is in the unmountedstate, may start such a check automatically, for example periodically ona regular time scheme, or when a mount command from the host H isdetected. In the latter situation, the drive DR performs first all thesteps for allocating the SDMA, before it allows the host H to mount andreach the disc D. In step S22, the drive DR checks for sufficient freespace FDA in the data area DAA, and allocates the required amount ofSDMA in this free space FDA in step S23. In step S24, the drive DRadapts the file system to the new situation.

No SDMA is allocated and the file system SF will not be updated if instep S21 no shortage of free space in the DMA areas allocated so far isdetected, or if in step S22 is detected that no free space FDA in thedata area DAA is present.

It is an advantage of this approach that the host H does not need tospend any time on the management of the SDMA. The extra intelligence hasto be present in the controller CC of the drive DR.

FIG. 6 shows a flowchart of an embodiment of the method of allocatingsupplemental defect management area. In step S31, the host H mounts thedisc D to be able to access the disc D. In step S32, the host H checkswhether the shortage of free space in the DMA's is expected. In stepS33, the host H checks whether and where sufficient free contiguousspace in the data area is present. In step S34, the host H communicatesto the drive DR where how much of the free data area FDA should be usedto allocate the SDMA. In step S35, the host H unmounts the disc D. Inthe further steps, the host H is not involved anymore and may performother tasks. In step S36, the drive DR actually allocates the SDMA, andin step S37, the drive DR adapts the file system information FS on thedisc D. It is also possible that the host H adapts the file systeminformation FS.

No SDMA is allocated if in step S32 no shortage of free space in the DMAarea allocated so far is detected, or if in step S33 is detected that nofree space FDA in the data area DAA is present, and the host willunmount the disc D in step S35, and the steps S36 and S37 will not beperformed.

FIG. 7 shows a flowchart of an embodiment of the method of allocatingsupplemental defect management area. In step S41, the host H mounts thedisc D to be able to access the disc D. In step S42, the drive DR checkswhether the shortage of free space in the DMA's is expected. In stepS43, the drive DR indicates to the host H that the shortage is expected.

In the optional step S44, the host H asks the user whether he wants tohave the DMA's enlarged. It might also be asked by how much. It ispossible to indicate to the user how many free data area is stillpresent, to support the decision. Depending on the decision of the user,SDMA will or will not be allocated in the further steps.

In the optional step S45, the host H may supply the relevant file systeminformation FS to the drive DR, if the drive DR is unable to read thefile system information FS from the disc DR itself.

In step S46, the host H indicates to the drive DR that it is allowed toextend the DMA's. In step S47, the host H unmounts the disc D. In stepS48, the drive DR checks whether and where sufficient free contiguousspace FDA in the data area DAA is present. In step S49, the drive DRallocates the SDMA, and in step S50, the drive DR adapts the file systemFS on the disc D, or communicates it to the host.

No SDMA is allocated and the file system FS will not be updated if instep S42 no shortage of free space in the DMA area allocated so far isdetected, or if in step S44 the user indicates that no SDMA should beallocated, or if in step S48 is detected that no free space FDA in thedata area DAA is present, and the process may jump to the end of theflowchart.

In this embodiment in accordance with the invention, the drive DRperforms most activities to allocate the SDMA, and the host H controlswhether the SDMA is allowed to be allocated and how large the SDMAshould be. It is possible to omit the steps S44 wherein the user inputis requested, the host may autonomously decide on the allocation andsize of the SDMA. If the drive DR is unable to read the file systeminformation FS stored on the disc D, in the optional step S45, the hostH provides the file system information FS to the drive DR to enable thedrive DR to perform the step S48.

FIG. 8 shows an example of the physical arrangement of areas on therecording disc and the logical arrangement of the corresponding areas atthe interface of the drive and the host.

The upper line indicates the positions of areas on the logical level thehost H communicates with the drive DR. The lower line indicates thepositions of the areas on the physical level wherein a particularposition corresponds to a particular radial position on the disc D.

Firstly, the situation is described before the supplementary defectmanagement area (SDMA) is allocated. In this example, on the physicallevel, from the left (the inner side of the disc D at the boundary withthe spindle hole) to the right (the outer side of the disc D) the nextareas are allocated: a disc definition area DDA from position 0 to d1, ageneral application area GAA from position d1 to d2, an alreadyavailable defect management area DMA from position d2 to d3, and a dataarea DAA wherein the user-data may be stored from position d3 to z, afurther already available defect management area DMA from position z tov, and an optional further disc definition area DDA. Finally, filesystem information FS is available in a file system area FSA and anextra file F1 in the data area DAA. This allocation of areas is anexample of a DVD disc. The allocation of areas may be different.

In this example, it is assumed that data DAF (for example, a file)starting at the position n and ending at the position n+y is present inthe physical data area DAA. A free contiguous data area FDA which can beused as supplemental defect management area (SDMA) is present from theposition m to m+x. The size of the FDA is too large to be allocated atthe end of the disc D because the data file DAF occupies too much spaceat the end of the disc D. Further, a defective area DFA is present atthe position k.

These areas may originally be directly (in a linear way) coupled to theaddresses on the logical level. Areas on the logical level whichcorrespond to associated areas on the disc D have the same referencepreceded by a letter “L”. The free data area FDA which is selected tobecome the supplemental defect management area SDMA originallycorresponds to the logical address area LFDA. The data file DAForiginally corresponds to the logical address area LDAFO.

The linear coupling has the disadvantage that after the free data areaFDA on the disc D is converted into SDMA, the logical addresses in thearea LFDA corresponding to the physical addresses m to m+x, occur in themiddle of the logical data area LDAA1. This causes a hole in the logicaladdress space which in some applications is undesirable or evenunacceptable. In such applications, it is necessary to have the logicaladdresses LSDMA for the SDMA at the start or the end of the logicaladdress space, such that a contiguous logical data area LDAA2 isavailable after the allocation of the SDMA on the disc D. Afterallocation of the SDMA, the logical addresses occupied by the LSDMA aretaken out from the logical data area LDAA1 as they are no longeravailable to write or read user data. On the logical level, the logicaldata area LDAA2 will extend now from the addresses 0 to 1-x.

If however, as shown in this example, the free space FDA in the dataarea DAA is not available at the physical end of the disc D because dataDAF is present at the end of the disc D, the conversion table has to beupdated to perform a conversion between the logical addresses and thephysical addresses of the SDMA.

In this example, after the SDMA is allocated in the free area FDA, thetable for management of the DMA's (which include the SDMA) is updated.This defect management table is usually present in the defect managementareas DMA's and may be present in the disc definition area DDA. Thedefect management table indicates where defective areas DFA on the discD occur and where in the DMA's these defective areas DFA are reallocatedsuch that an attempt to read data from or write data to the defectivearea DFA is redirected to the proper area in the DMA's. As an example, adefective area DFA at the physical position k is redirected by thistable to the DMA area allocated from physical position d2 to d3.

The file system information FS has to be updated such that the hostrequests updated addresses when it wants to access the data DAF at thephysical addresses n to n−y. The original logical address area LFDAO isnow occupied by the SDMA. Thus, the file system information has to beupdated such that the logical addresses LDAF points to the physicaladdress area DAF. In this manner, the data DAF which is physicallypresent at the end of the disc D is still accessible by the host H.

Consequently, on the logical level, from the left (lowest address orlogical sector) to the right (highest address), the following areas arepresent. A file system area LFSA up to logical address 0. A data areaLDAA1 which starts at the logical address 0 and ends at the address 1,before the SDMA is allocated. A data area LDAA2 which starts at thelogical address 0 and ends at the logical address 1-x, after the SDMA isallocated. A data file LDAF from logical address p to p+y whichcorresponds to the data file DAF on the physical level from address n ton+y, and a file system area LFSA at the end.

In a preferred embodiment, when the disc D is mounted, as backgroundprocess, the drive DR copies the data DAF to another physical position,which allows the SDMA to be copied to the physical end of the disc D.Preferably, the data DAF is copied in small batches, such that the hosthas fast access to the disc D when required, and such that the disc willbe promptly ejected when the user activates the eject button. This hasthe advantage that the time consuming copying process is performed whenthe drive DR is not in use. The user will not be annoyed by the copyingprocess.

It should be noted that the above-mentioned embodiments illustraterather than limit the invention, and that those skilled in the art willbe able to design many alternative embodiments without departing fromthe scope of the appended claims.

For example, the areas on the disc D may have different positions thanshown. The optical disc is an example only, the invention can be appliedto recording mediums in general. The format of the disc may be differfrom the format shown, different areas may be present.

In the claims, any reference signs placed between parentheses shall notbe construed as limiting the claim. The word “comprising” does notexclude the presence of elements or steps other than those listed in aclaim. The invention can be implemented by means of hardware comprisingseveral distinct elements, and by means of a suitably programmedcomputer. In the device claim enumerating several means, several ofthese means can be embodied by one and the same item of hardware. Themere fact that certain measures are recited in mutually differentdependent claims does not indicate that a combination of these measurescannot be used to advantage.

1. A method of accessing a recording medium comprising a data area and a defect management area, in a system comprising a drive for writing data to or reading data from the recording medium, and a host for sending data to or for receiving data from the drive when the recording medium is in a mounted state wherein file system information is available to the host, the method comprising the acts of: detecting whether a shortage of free space in the defect management area is to be expected, allocating supplemental defect management area at the cost of the data area when the shortage has been detected, and adapting the file system information to reflect a latest state of availability of the data area and the allocated supplemental defect management area, during an unmounting phase wherein the host unmounts the disc, wherein the drive performs the adapting after the host unmounted the recording medium.
 2. The method of accessing a recording medium as claimed in claim 1, wherein the host performs the detecting for providing information to the drive comprising an indication of a usage of free space in the defect management area allocated so far, and of a free area in the data area which can be allocated to become the supplemental defect management area, the information being supplied to the drive at a start of the unmounting phase, the drive performing the allocating after the host unmounted the recording medium.
 3. The method of accessing a recording medium as claimed in claim 1, wherein the drive further performs the detecting for evaluating the file system information recorded on the recording medium after the host unmounted the recording medium.
 4. The method of accessing a recording medium as claimed in claim 1, wherein the drive performs the detecting, the drive further comprises communicating to the host that the shortage has been detected, the host further comprises deciding on whether the defect management area should be enlarged or not, and if yes, indicating to the drive that the defect management area should be enlarged, and unmounting the recording medium, the drive further checks the file system information on availability of a sufficient large contiguous free area in the data area, and the drive performs the allocating and the adapting.
 5. The method of accessing a recording medium as claimed in claim 4, wherein the host provides the file system information to the drive before the unmounting.
 6. The method of accessing a recording medium as claimed in claim 1, wherein the allocating further comprises checking the data area to allocate a contiguous free part of the data area, wherever available, to become the supplemental defect management area by updating a defect table in the defect management areas accordingly.
 7. The method of accessing a recording medium as claimed in claim 6, wherein the allocating further comprises updating the file system information such that a physical address area of a used part of the data area at the start or the end of the disc is coupled to a logical address area within the logical address area originally being coupled to the contiguous free part of the data area.
 8. The method of accessing a recording medium as claimed in claim 7, wherein the drive further comprises copying the supplemental defect management area if not physically allocated at the start or the end of the disk to the start or the end of the disk during a background process when the disc is mounted and is not in use by the host.
 9. A recording medium comprising a disc definition area in which information is recorded indicating that it is allowable to perform the method as claimed in claim 1 on the recording medium.
 10. A method of accessing a recording medium comprising a data area and a defect management area, in a system comprising a drive for writing data to or reading data from the recording medium, and a host for sending data to or for receiving data from the drive when the recording medium is in a mounted state wherein file system information is available to the host, the method comprising the acts of: detecting whether a shortage of free space in the defect management area is to be expected, allocating supplemental defect management area at the cost of the data area when the shortage has been detected, and adapting the file system information to reflect a latest state of availability of the data area and the allocated supplemental defect management area, during an unmounting phase wherein the host unmounts the disc; wherein the drive further comprises communicating to the host that the shortage has been detected, the host further comprises deciding on whether the defect management area should be enlarged or not, and if yes, indicating to the drive that the defect management area should be enlarged, and unmounting the recording medium, the drive further checks the file system information on availability of a sufficient large contiguous free area in the data area, and the drive performs the allocating and the adapting, and wherein in-between the communicating and the unmounting, the host asks input from a user whether enlargement of the defect management area at the cost of the data area is acceptable, and the host indicates to the drive that the defect management area should be enlarged, only if the user indicated to do so.
 11. The method of accessing a recording medium as claimed in claim 10, wherein the host further determines an amount of the contiguous free space available, and indicates this amount to the user.
 12. A method of accessing a recording medium comprising a data area and a defect management area, in a system comprising a drive for writing data to or reading data from the recording medium, and a host for sending data to or for receiving data from the drive when the recording medium is in a mounted state wherein tile system information is available to the host, the method comprising the acts of: detecting whether a shortage of free space in the defect management area is to be expected, allocating supplemental defect management area at the cost of the data area when the shortage has been detected, and adapting the tile system information to reflect a latest state of availability of the data area and the allocated supplemental defect management area, during an unmounting phase wherein the host unmounts the disc; wherein the drive further comprises communicating to the host that the shortage has been detected, the host further comprises deciding on whether the defect management area should be enlarged or not, and if yes, indicating to the drive that the defect management area should be enlarged, and unmounting the recording medium, the drive further checks the file system information on availability of a sufficient large contiguous free area in the data area, and the drive performs the allocating and the adapting, and wherein the drive reads the file system information from the recording medium after the unmounting.
 13. An apparatus for accessing a recording medium comprising a data area and a defect management area, the apparatus comprising: a drive for writing data to or reading data from the recording medium, a host for sending data to or for receiving data from the drive when the drive is in a mounted state wherein file system information is available to the host, means for detecting whether a shortage of free space in the defect management area is to be expected, means for allocating supplemental defect management area at the cost of the data area when the shortage has been detected, and means for adapting the file system information to reflect a latest state of availability of the data area and the allocated supplemental defect management area, during an unmounting phase wherein the host unmounts the recording medium, wherein the drive performs the adapting after the host unmounted the recording medium. 